<template>
  <div>
    <el-form :model="formlist" ref="riskFormRef" :rules="rules" label-width="100px">
      <el-row :gutter="20">
        <el-col :span="24">
          <div>单位信息</div>
          <el-divider></el-divider>
          <el-row>
            <el-col :span="24">
              <el-form-item label="单位名称" prop="name" required>
                <el-input v-model="formlist.name" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="简称" prop="otherName" required>
                <el-input v-model="formlist.otherName" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="单位性质" prop="property" required>
                <el-select v-model="formlist.property" clearable :style="{width: '100%'}">
                  <el-option v-for="(v,i) in dict.dwxzType" :key="i" :label="v.itemName" :value="v.dictItemId"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="行业类型" prop="domain">
                <el-input v-model="formlist.domain" clearable></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系人" prop="linker" required>
                <el-input v-model="formlist.linker" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系方式" prop="linkTel" required>
                <el-input v-model="formlist.linkTel" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="负责人" prop="director" required>
                <el-input v-model="formlist.director" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="负责人联系方式" prop="directorTel" >
                <el-input v-model="formlist.directorTel" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系邮箱" prop="email">
                <el-input v-model="formlist.email" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="会员级别" prop="vipLevel">
                <el-select v-model="formlist.vipLevel" clearable :style="{width: '100%'}">
                  <el-option label="普通" value="普通"></el-option>
                  <el-option label="vip" value="vip"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="单位地址" prop="address" required>
                <el-input v-model="formlist.address" type="textarea" clearable :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
               <el-form-item label="状态">
                <el-select v-model="formlist.status">
                  <el-option label="启用" :value="1"></el-option>
                  <el-option label="停用" :value="0"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>

<!--        <el-col :span="12">-->
<!--          &lt;!&ndash; <el-form-item label="备注" label-width="40px" prop="chineseName">-->
<!--            <el-input type="textarea" v-model="formlist.remark" class="textarea"></el-input>-->
<!--          </el-form-item> &ndash;&gt;-->
<!--          <div>附件</div>-->
<!--          <el-divider></el-divider>-->

<!--          <div class="add_jian">-->
<!--            &lt;!&ndash; <el-button>添加附件</el-button>-->
<!--            <span>1、个人资料.xsl</span>-->
<!--            <span>2、20210601合同.doc</span> &ndash;&gt;-->
<!--            <el-upload-->
<!--                class="upload-demo"-->
<!--                action="https://jsonplaceholder.typicode.com/posts/"-->
<!--                :on-preview="handlePreview"-->
<!--                :on-remove="handleRemove"-->
<!--                :before-remove="beforeRemove"-->
<!--                multiple-->
<!--                :limit="3"-->
<!--                :on-exceed="handleExceed"-->
<!--                :file-list="fileList">-->
<!--              <el-button size="small">添加附件</el-button>-->
<!--              <div slot="tip" class="el-upload__tip">1、个人资料.xsl<br>-->
<!--                2、20210601合同.doc-->
<!--              </div>-->
<!--            </el-upload>-->
<!--          </div>-->
<!--        </el-col>-->

      </el-row>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'tempname',
  data() {
    return {
      formLabelWidth:'80px',
      unitStatus:true,
      rules: {},
      formlist: {
        ...this.queryform,
        property:parseInt(this.queryform.property)||'',
      },
      dict: this.dictdata,
			// 上传参数
			fileList:[],
    }
  },
  // props: ['getform','object'],  //任何类型的值
  props: {
  	queryform:{
  		type: Object,
  		defalut:{}
  	},
    dictdata: {
      type: Object,
      default: {}
    }
  },
  watch: {
  	queryform(newValue, oldValue) {
  		this.formlist =  {
        ...newValue,
        property:parseInt(newValue.property)||'',
      }
  	},
    dictdata(newValue, oldValue) {
      this.dict = newValue;
    },
  },
  methods: {
		// 上传
		handleRemove(file, fileList) {
			console.log(file, fileList);
		},
		handlePreview(file) {
			console.log(file);
		},
		handleExceed(files, fileList) {
			this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
		},
		beforeRemove(file, fileList) {
			return this.$confirm(`确定移除 ${ file.name }？`);
		},
  }
}
</script>
<style scoped>
.text_a {
  width: 50%;
}

.tan_k {
  display: flex;
  justify-content: space-between;
}

.tan_t {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #cccccc;
}
</style>
